#ifndef _FXHAL_
#define _FXHAL_

//*****************************************************************************
//* openCV-based DIB functions
//*****************************************************************************
FX_DEFINEHANDLE(FXHAL_HMODULE)
/** @brief Initialize the OpenCV global variables. */
FXHAL_HMODULE		FXHAL_Initialize(FXMEM_FoxitMgr* pMemMgr);
/** @brief OpenCV memory free operation. */
void				FXHAL_Finalize(FXHAL_HMODULE halModule);

/** @brief interpolation method. */
#define FXHAL_INTERPOLATION_NEAREST			0
#define FXHAL_INTERPOLATION_BILINEAR		1
#define FXHAL_INTERPOLATION_BICUBIC			2
#define FXHAL_INTERPOLATION_AREABASED		3
#define FXHAL_INTERPOLATION_LANCZOS			4

/**
 * @brief Flip image, one image.
 *
 * @param[in] diBitmap	The DIB source.
 * @param[in] flipMode	0 means flipping around the x-axis, 1 means flipping around the y-axis, 2 means flipping around both axes.
 * @return A flipped bitmap.
 */
CFX_DIBitmap*		FXHAL_Bitmap_Flip(const CFX_DIBSource* diBitmap, FX_INT32 flipMode);

/**
 * @brief Flip image, two images.
 *
 * @param[in] diBitmapSrc		The DIB source.
 * @param[in] flipMode			0 means flipping around the x-axis, 1 means flipping around the y-axis, 2 means flipping around both axes.
 * @param[in, out] diBitmapDst	The DIB destination.
 * @param[in] xPos				The offset of x-coordinate of the left-top corner in source.
 * @param[in] yPos				The offset of y-coordinate of the left-top corner in source.
 * @param[in] dstClipBox		The clipping region of destination bitmap.
 * @param[in] pIccTransform		The color mapping context for source format to destination.
 * @return	Return 0 value if successful;
 *			Return -1 if any error occurs.
 */
FX_INT32			FXHAL_Bitmap_Flip(const CFX_DIBSource* diBitmapSrc, FX_INT32 flipMode, CFX_DIBitmap* diBitmapDst, FX_INT32 xPos, FX_INT32 yPos, const CFX_Rect* dstClipBox, void* pIccTransform = NULL);

/**
 * @brief Stretch a bitmap, one image.
 *
 * @param[in] diBitmap			The DIB source.
 * @param[in] newWidth			The width of the destination bitmap.
 * @param[in] newHeight			The height of the destination bitmap.
 * @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
 * @param[in] clipBox			The clipping region of destination bitmap.
 * @return A stretched bitmap.
 */
CFX_DIBitmap*		FXHAL_Bitmap_Scale(const CFX_DIBSource* diBitmap, FX_INT32 newWidth, FX_INT32 newHeight, FX_INT32 interpolation, const FX_RECT* clipBox = NULL);

/**
 * @brief Stretch a bitmap, two images.
 *
 * @param[in] diBitmapSrc		The DIB source.
 * @param[in] newWidth			The width of the destination bitmap.
 * @param[in] newHeight			The height of the destination bitmap.
 * @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
 * @param[in, out] diBitmapDst	The DIB destination.
 * @param[in] xPos				The offset of x-coordinate of the left-top corner in source.
 * @param[in] yPos				The offset of y-coordinate of the left-top corner in source.
 * @param[in] dstClipBox		The clipping region of destination bitmap.
 * @param[in] pIccTransform		The color mapping context for source format to destination.
 * @return	Return 0 value if successful;
 *			Return -1 if any error occurs.
 */
FX_INT32			FXHAL_Bitmap_Scale(const CFX_DIBSource* diBitmapSrc, FX_INT32 newWidth, FX_INT32 newHeight, FX_INT32 interpolation,
									   CFX_DIBitmap* diBitmapDst, FX_INT32 xPos, FX_INT32 yPos, const CFX_Rect* dstClipBox, void* pIccTransform = NULL);

/**
 * @brief Rotate a bitmap, one image.
 *
 * @param[in] diBitmap			The DIB source.
 * @param[in] radian			The radians of Rotation angle.
 * @param[in] backColor			The background fill color.
 * @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
 * @param[in, out] left			It receives x-coordinate of the left-top corner of the result bitmap in destination coords.
 * @param[in, out] top			It receives y-coordinate of the left-top corner of the result bitmap in destination coords.
 * @param[in] clipBox			The clipping region of destination bitmap.
 * @return A rotated bitmap.
 */
CFX_DIBitmap*		FXHAL_Bitmap_Rotate(const CFX_DIBSource* diBitmap, FX_FLOAT radian, FX_DWORD backColor, FX_INT32 interpolation, FX_INT32& left, FX_INT32 &top, const FX_RECT* clipBox = NULL);

/**
 * @brief Rotate a bitmap, two images.
 *
 * @param[in] diBitmapSrc		The DIB source.
 * @param[in] radian			The radians of Rotation angle.
 * @param[in] backColor			The background fill color.
 * @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
 * @param[in, out] diBitmapDst	The DIB destination.
 * @param[in] xPos				The offset of x-coordinate of the left-top corner in source.
 * @param[in] yPos				The offset of y-coordinate of the left-top corner in source.
 * @param[in] dstClipBox		The clipping region of destination bitmap.
 * @param[in] pIccTransform		The color mapping context for source format to destination.
 * @return	Return 0 value if successful;
 *			Return -1 if any error occurs.
 */
FX_INT32			FXHAL_Bitmap_Rotate(const CFX_DIBSource* diBitmapSrc, FX_FLOAT radian, FX_DWORD backColor, FX_INT32 interpolation,
										CFX_DIBitmap* diBitmapDst, FX_INT32 xPos, FX_INT32 yPos, const CFX_Rect* dstClipBox, void* pIccTransform = NULL);

/**
* @brief Transform a bitmap, one image.
*
* @param[in] diBitmap			The DIB source.
* @param[in] matrix				The transformation matrix.
* @param[in] backColor			The background fill color.
* @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
* @param[in, out] left			It receives x-coordinate of the left-top corner of the result bitmap in destination coords.
* @param[in, out] top			It receives y-coordinate of the left-top corner of the result bitmap in destination coords.
* @param[in] clipBox			The clipping region of destination bitmap.
* @return A transformed bitmap.
 */
CFX_DIBitmap*		FXHAL_Bitmap_Affine(const CFX_DIBSource* diBitmap, const CFX_Matrix* matrix, FX_DWORD backColor, FX_INT32 interpolation, FX_INT32& left, FX_INT32 &top, const FX_RECT* clipBox = NULL);

/**
 * @brief Transform a bitmap, two images.
 *
 * @param[in] diBitmapSrc		The DIB source.
 * @param[in] matrix			The transformation matrix.
 * @param[in] backColor			The background fill color.
 * @param[in] interpolation		The interpolation method, it can use FXHAL_INTERPOLATION_NEAREST, FXHAL_INTERPOLATION_BILINEAR etc.
 * @param[in, out] diBitmapDst	The DIB destination.
 * @param[in] xPos				The offset of x-coordinate of the left-top corner in source.
 * @param[in] yPos				The offset of y-coordinate of the left-top corner in source.
 * @param[in] dstClipBox		The clipping region of destination bitmap.
 * @param[in] pIccTransform		The color mapping context for source format to destination.
 * @return	Return 0 value if successful;
 *			Return -1 if any error occurs.
 */
FX_INT32			FXHAL_Bitmap_Affine(const CFX_DIBSource* diBitmapSrc, const CFX_Matrix* matrix, FX_DWORD backColor, FX_INT32 interpolation,
										CFX_DIBitmap* diBitmapDst, FX_INT32 xPos, FX_INT32 yPos, const CFX_Rect* dstClipBox, void* pIccTransform = NULL);

/**
 * @brief Composite, blend and clipping source bitmap into this bitmap.
 *
 * @param[in] diBitmapSrc		The DIB source.
 * @param[in, out] diBitmapDst	The DIB destination.
 * @param[in] blendMode			Blend type.
 * @param[in] xPos				The offset of x-coordinate of the left-top corner in source.
 * @param[in] yPos				The offset of y-coordinate of the left-top corner in source.
 * @param[in] dstClipBox		The clipping region of destination bitmap.
 * @param[in] pIccTransform		The color mapping context for source format to destination.
 * @return	Return 0 value if successful;
 *			Return -1 if any error occurs.
 */
FX_INT32			FXHAL_Bitmap_Blend(const CFX_DIBSource* diBitmapSrc, CFX_DIBitmap* diBitmapDst, FX_INT32 blendMode, FX_INT32 xPos, FX_INT32 yPos, const CFX_Rect* dstClipBox, void* pIccTransform = NULL);

//*****************************************************************************
//* CPU info
//*****************************************************************************
/**
 * @brief Get cpu type.
 *
 * @return	Return 0 Intel;
 *			Return 1 AMD
 *			Return 2 ARM
 *			Return 3 X86
 *			Return 4 Other
 */
FX_INT32			FXHAL_CPUInfo_GetType();

#define FXHAL_CPUINFO_FEATURES_NONE			0x0000
#define FXHAL_CPUINFO_FEATURES_MMX			0x0001
#define FXHAL_CPUINFO_FEATURES_SSE			0x0002
#define FXHAL_CPUINFO_FEATURES_SSE2			0x0004
#define FXHAL_CPUINFO_FEATURES_SSE3			0x0008
#define FXHAL_CPUINFO_FEATURES_SSSE3		0x0010
#define FXHAL_CPUINFO_FEATURES_SSE41		0x0020
#define FXHAL_CPUINFO_FEATURES_SSE42		0x0040
#define FXHAL_CPUINFO_FEATURES_AES			0x0080
#define FXHAL_CPUINFO_FEATURES_AVX			0x0100

/**
 * @brief Get cpu support instruction set information.
 *
 * @return 0x0000 None
 *         0x0001 MMX or NEON
 *         0x0002 SSE 
 *         0x0004 SSE2
 *         0x0008 SSE3
 *         0x0010 SSSE3
 *		   0x0020 SSE41
 *		   0x0040 SSE42
 *         0x0080 AES
 *		   0x0100 AVX
 */
FX_DWORD			FXHAL_CPUInfo_GetFeatures();

/**
 * @brief Whether to support the specified instruction set.
 *
 * @return	Return TRUE, support;
 *			Return FALSE, no support
 */
FX_BOOL				FXHAL_CPUInfo_IsFeatureSupported(FX_DWORD featureItem);

/**
 * @brief Get cpu core number.
 *
 * @return	cpu core number.
 */
FX_INT32			FXHAL_CPUInfo_CountProcessors();

//*****************************************************************************
//* SIMD-based DIB compositions
//*****************************************************************************
class CFXHAL_SIMDContext : public CFX_Object
{
public:
	virtual				~CFXHAL_SIMDContext(){}

	virtual FX_BOOL		Initialize(FX_INT32 blendType, FX_INT32 rowWidth, FX_INT32 srcChannelNum, FX_INT32 dstChannelNum, void* pIccTransform) {return FALSE;}
	virtual FX_BOOL		Finalize() {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPBYTE dataDst, FX_LPCBYTE clipScan) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE alphaScanDst) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE alphaScanSrc) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_ARGB* palette, FX_INT32 srcLeft) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc, FX_LPCBYTE palette, FX_INT32 srcLeft) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc, FX_DWORD* palette, FX_INT32 srcLeft) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_INT32 graySrc, FX_INT32 alphaMask, FX_INT32 srcLeft, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE  alphaScanDst, FX_INT32 alphaScanSrc) {return FALSE;}
	virtual FX_BOOL		SetData(FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE alphaScanDst, FX_BOOL bAlphaDst, FX_BOOL bArgbDst, FX_INT32 alphaMask) {return FALSE;}
	virtual	FX_BOOL		GetData(FX_LPBYTE dataDst) {return FALSE;}
	virtual FX_BOOL		GetData(FX_LPBYTE dataDst, FX_LPBYTE alphaScanDst) {return FALSE;}
	virtual FX_BOOL		run() = 0; 
};

CFXHAL_SIMDContext*		FXHAL_SIMDContext_Create(FX_INT32 algorithm, FX_INT32 blendType, FX_INT32 rowWidth, FX_INT32 srcChannelNum, FX_INT32 dstChannelNum, void* pIccTransform);

FX_BOOL					FXHAL_SIMDComposition_Argb2Argb(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Argb_Transform(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Argb_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Cmyka2Mask(CFXHAL_SIMDContext* context, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE alphaExtraSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Mask(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgba2Mask(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Mask(CFXHAL_SIMDContext* context, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Rgb2Argb_Blend_NoClip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE alphaScanDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Argb_Blend_NoClip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Argb_Blend_Clip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE alphaScanDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Argb_Blend_Clip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL                 FXHAL_SIMDComposition_Rgb2Argb_NoBlend_Clip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Argb_NoBlend_Clip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE alphaScanSrc);			
FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_NoBlend_Transform(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan,  FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_NoBlend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_Blend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_Blend_Transform(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan,  FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Rgb_Blend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_Blend_NoClip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_Blend_NoClip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_Blend_Clip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_Blend_Clip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_NoBlend_Clip(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Argb2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Argb2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst);
FX_BOOL					FXHAL_SIMDComposition_Rgb2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan);

FX_BOOL					FXHAL_SIMDComposition_Cmyka2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_Cmyka2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan,  FX_LPCBYTE alphaScanSrc);

FX_BOOL					FXHAL_SIMDComposition_BitMask2Mask(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 srcLeft, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_INT32 graySrc, FX_INT32 srcLeft, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 graySrc, FX_INT32 srcLeft, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Argb_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 srcLeft, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Rgb_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 srcLeft, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Argb(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 srcLeft, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_BitMask2Rgb(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 srcLeft, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);

FX_BOOL					FXHAL_SIMDComposition_ByteMask2Mask(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_INT32 graySrc, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 graySrc, FX_INT32 alphaMask);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Argb_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Rgb_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Argb(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Rgb(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);
FX_BOOL					FXHAL_SIMDComposition_ByteMask2Rgba(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_INT32 alphaMask, FX_INT32 srcR, FX_INT32 srcG, FX_INT32 srcB);

FX_BOOL					FXHAL_SIMDComposition_DIBitmapCompositeRect(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPBYTE  alphaScanDst, FX_BOOL bAlphaDst, FX_BOOL bArgbDst, FX_INT32 alphaMask);

FX_BOOL					FXHAL_SIMDComposition_1bppRgb2Argb_NoBlend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_ARGB* palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppRgb2Rgb_NoBlend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_ARGB* palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppPal2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPBYTE alphaScanDst, FX_LPCBYTE palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppPal2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppRgb2Argb_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppRgb2Rgb_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_1bppRgb2Rgba_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_LPBYTE alphaScanDst, FX_INT32 srcLeft);
FX_BOOL					FXHAL_SIMDComposition_8bppRgb2Argb_NoBlend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_ARGB* palette);
FX_BOOL					FXHAL_SIMDComposition_8bppRgb2Rgb_NoBlend_RgbByteOrder(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_ARGB* palette);
FX_BOOL					FXHAL_SIMDComposition_8bppPal2Graya(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE palette, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_8bppPal2Gray(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_LPCBYTE palette, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_8bppRgb2Argb_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_8bppRgb2Rgb_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_LPCBYTE alphaScanSrc);
FX_BOOL					FXHAL_SIMDComposition_8bppRgb2Rgba_NoBlend(CFXHAL_SIMDContext* context, FX_LPCBYTE dataSrc, FX_LPBYTE dataDst, FX_LPCBYTE clipScan, FX_DWORD* palette, FX_LPBYTE alphaScanDst, FX_LPCBYTE alphaScanSrc);

#endif //_FXHAL_


